import { defineComponent } from "vue";

const Edit =  defineComponent({
    props:{
        html:[Object]
    },
    setup(props,{ slots }) {
        console.log("dddddddd",props.html)
        let {attribute,data,editorComponent} = props.html
        let render = () => {
            
            // let b = {props.html.isInside}
            return (
                (   <div style="padding:5px">
                    <fieldset>
                        <legend align="right">
                            <div>表单</div>                       
                        </legend>
                        <editorComponent style="pointer-events: none;user-select: none;" {...attribute}>{ slots.default?.() || data || ''}
                        {
                            props.html.children && props.html.children.map(i=>{
                                console.log("sssss",i)
                                return <Edit html={i}>
                                    <fieldset style="height:50px"></fieldset>
                                </Edit>
                            })
                        }          
                        </editorComponent>
                    </fieldset>
                    </div>
                )
                
            ) 
        }
        return render
    }
})

export default Edit